// Copyright (c) Huawei Technologies Co., Ltd. 2025. All rights reserved.
// This source file is part of the Cangjie project, licensed under Apache-2.0
// with Runtime Library Exception.
//
// See https://cangjie-lang.cn/pages/LICENSE for license information.

#ifndef CANGJIE_MIGRATOR_MIGRATORS_FILE_MIGRATOR
#define CANGJIE_MIGRATOR_MIGRATORS_FILE_MIGRATOR

#include "CangjieTools/Compiler.h"
#include "Migrators/Migrator.h"
#include "Rules/RuleList.h"

namespace CangjieMigrator {

class FileMigrator final : public Migrator {
public:
    FileMigrator(Path cangjieHome, Option option, std::string version, std::unique_ptr<Rules::RuleList> rules);

    bool Convert() override;

private:
    CangjieTools::Compiler compiler;

    const Path source;
    const Path target;
    const Path importPath;
    UpdateInstance::File file;
};

}  // namespace CangjieMigrator

#endif // CANGJIE_MIGRATOR_MIGRATORS_FILE_MIGRATOR
